package dk.aau.walkietalkieui;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;

public class UINotification extends Activity {
	private static final int NOTIFICATION_ID = 1;

	public void showNotification(String title, String message) {
		NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

		Intent notificationIntent = new Intent(this, UINotification.class);
		PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
				notificationIntent, 0);

		// the next two lines initialize the Notification, using the
		// configurations above
		Notification notification = new Notification(R.drawable.ic_launcher,
				"Walkie talkie", System.currentTimeMillis());
		notification.defaults |= Notification.DEFAULT_SOUND;
		notification.defaults |= Notification.DEFAULT_VIBRATE;
		notification.setLatestEventInfo(this, title, message, contentIntent);

		mNotificationManager.notify(NOTIFICATION_ID, notification);
	}
}
